package com.yanqu.road.server.cmd.crossunion;

import com.yanqu.road.entity.union.UnionBaseInfo;
import com.yanqu.road.logic.pb.UnionBasePb;
import com.yanqu.road.pb.crossunion.activity.CrossUnionActivityRankDataProto;
import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.union.CrossUnionActivityDataMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_UNION_ACTIVITY_ADD_TRADE_EXP,desc = "")
public class CrossUnionActivityAddTradeExpCmd extends CrossCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionActivityRankDataProto.CrossAddUnionTradeExpReqMsg req = CrossUnionActivityRankDataProto.CrossAddUnionTradeExpReqMsg.parseFrom(packet.getBytes());
        int activityId = req.getActivityId();
        UnionBaseInfo unionBaseInfo = UnionBasePb.parseUnionBaseInfo(req.getUnionBaseInfo());
        String unionId = req.getUnionId();
        long addValue = req.getAddValue();
        CrossUnionActivityDataMgr.addUnionRankValue(activityId, unionId, addValue, unionBaseInfo);
    }

    @Override
    public void sendData() {

    }
}
